package com.kai.awt.layoutmanager;

import java.awt.*;

/**
 * @Author Mr.Yan
 * @create 2022/3/19 20:34
 * @description: GridLayout
 */
public class Demo5 {
    public static void main(String[] args) {
        Frame frame = new Frame("test5");


        frame.add(new Button("11"),BorderLayout.NORTH);

        Panel panel = new Panel();
        panel.setLayout(new GridLayout(3,5));
        for (int i = 0; i < 15; i++) {
            panel.add(new Button(""+i));
        }
        frame.add(panel);

        frame.pack();
        frame.setVisible(true);
    }
}
